# -*- coding: utf-8 -*-
#
#  PyiiASMH (mainwindow_ui.py)
#  Copyright (c) 2011, 2012, Sean Power
#  All rights reserved.
#
#  Redistribution and use in source and binary forms, with or without
#  modification, are permitted provided that the following conditions are met:
#      * Redistributions of source code must retain the above copyright
#        notice, this list of conditions and the following disclaimer.
#      * Redistributions in binary form must reproduce the above copyright
#        notice, this list of conditions and the following disclaimer in the
#        documentation and/or other materials provided with the distribution.
#      * Neither the names of the authors nor the
#        names of its contributors may be used to endorse or promote products
#        derived from this software without specific prior written permission.
#   
#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
#  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
#  DISCLAIMED. IN NO EVENT SHALL SEAN POWER BE LIABLE FOR ANY
#  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
#  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
#  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
#  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
#  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

try:
    from PySide import QtCore, QtGui
except ImportError:
    from PyQt4 import QtCore, QtGui

import icons_rc

class MainWindowUi(QtGui.QMainWindow):
    def __init__(self):
        super(MainWindowUi, self).__init__()

        self.close_event = False
        self.setupUi()

    def set_close_event(self, close_event):
        self.close_event = close_event

    def closeEvent(self, event):
        if self.close_event:
            reply = QtGui.QMessageBox(self)
            reply.setWindowTitle("Quit PyiiASMH")
            reply.setText("Are you sure you want to quit?")
            reply.setInformativeText("Unsaved data will be lost.")
            reply.setIcon(QtGui.QMessageBox.Warning)
            reply.setIcon(QtGui.QMessageBox.Warning)
            reply.setStandardButtons(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)
            reply.setDefaultButton(QtGui.QMessageBox.No)

            if reply.exec_() == QtGui.QMessageBox.No:
                event.ignore()
            else:
                event.accept()
        else:
            event.accept()

    def setupUi(self):
        self.setObjectName("MainWindow")
        self.setWindowModality(QtCore.Qt.NonModal)
        self.setEnabled(True)
        self.resize(494, 575)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.sizePolicy().hasHeightForWidth())
        self.setSizePolicy(sizePolicy)
        self.setMinimumSize(QtCore.QSize(494, 575))
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.setFont(font)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/main_icons/.icons/PyiiASMH.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.setWindowIcon(icon)
        self.centralwidget = QtGui.QWidget(self)
        self.centralwidget.setObjectName("centralwidget")
        self.gridLayout = QtGui.QGridLayout(self.centralwidget)
        self.gridLayout.setObjectName("gridLayout")
        self.codeinfoLayout = QtGui.QGridLayout()
        self.codeinfoLayout.setHorizontalSpacing(15)
        self.codeinfoLayout.setObjectName("codeinfoLayout")
        self.bapoLabel = QtGui.QLabel(self.centralwidget)
        self.bapoLabel.setEnabled(False)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.bapoLabel.sizePolicy().hasHeightForWidth())
        self.bapoLabel.setSizePolicy(sizePolicy)
        self.bapoLabel.setMinimumSize(QtCore.QSize(100, 23))
        self.bapoLabel.setMaximumSize(QtCore.QSize(16777215, 23))
        self.bapoLabel.setTextFormat(QtCore.Qt.PlainText)
        self.bapoLabel.setScaledContents(False)
        self.bapoLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
        self.bapoLabel.setWordWrap(True)
        self.bapoLabel.setObjectName("bapoLabel")
        self.codeinfoLayout.addWidget(self.bapoLabel, 0, 0, 1, 1)
        self.bapoLineEdit = QtGui.QLineEdit(self.centralwidget)
        self.bapoLineEdit.setEnabled(False)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.bapoLineEdit.sizePolicy().hasHeightForWidth())
        self.bapoLineEdit.setSizePolicy(sizePolicy)
        self.bapoLineEdit.setMinimumSize(QtCore.QSize(80, 23))
        self.bapoLineEdit.setMaximumSize(QtCore.QSize(80, 23))
        font = QtGui.QFont()
        font.setFamily("Monospace")
        self.bapoLineEdit.setFont(font)
        self.bapoLineEdit.setText("")
        self.bapoLineEdit.setMaxLength(8)
        self.bapoLineEdit.setFrame(True)
        self.bapoLineEdit.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
        self.bapoLineEdit.setObjectName("bapoLineEdit")
        self.codeinfoLayout.addWidget(self.bapoLineEdit, 0, 2, 1, 1)
        self.xorLabel = QtGui.QLabel(self.centralwidget)
        self.xorLabel.setEnabled(False)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.xorLabel.sizePolicy().hasHeightForWidth())
        self.xorLabel.setSizePolicy(sizePolicy)
        self.xorLabel.setMinimumSize(QtCore.QSize(100, 23))
        self.xorLabel.setMaximumSize(QtCore.QSize(16777215, 23))
        self.xorLabel.setTextFormat(QtCore.Qt.PlainText)
        self.xorLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
        self.xorLabel.setObjectName("xorLabel")
        self.codeinfoLayout.addWidget(self.xorLabel, 1, 0, 1, 1)
        self.xorLineEdit = QtGui.QLineEdit(self.centralwidget)
        self.xorLineEdit.setEnabled(False)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.xorLineEdit.sizePolicy().hasHeightForWidth())
        self.xorLineEdit.setSizePolicy(sizePolicy)
        self.xorLineEdit.setMinimumSize(QtCore.QSize(50, 23))
        self.xorLineEdit.setMaximumSize(QtCore.QSize(50, 23))
        font = QtGui.QFont()
        font.setFamily("Monospace")
        self.xorLineEdit.setFont(font)
        self.xorLineEdit.setText("")
        self.xorLineEdit.setMaxLength(4)
        self.xorLineEdit.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
        self.xorLineEdit.setObjectName("xorLineEdit")
        self.codeinfoLayout.addWidget(self.xorLineEdit, 1, 2, 1, 1)
        self.checksumLabel = QtGui.QLabel(self.centralwidget)
        self.checksumLabel.setEnabled(False)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.checksumLabel.sizePolicy().hasHeightForWidth())
        self.checksumLabel.setSizePolicy(sizePolicy)
        self.checksumLabel.setMinimumSize(QtCore.QSize(100, 23))
        self.checksumLabel.setMaximumSize(QtCore.QSize(16777215, 23))
        self.checksumLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
        self.checksumLabel.setObjectName("checksumLabel")
        self.codeinfoLayout.addWidget(self.checksumLabel, 2, 0, 1, 1)
        self.checksumLineEdit = QtGui.QLineEdit(self.centralwidget)
        self.checksumLineEdit.setEnabled(False)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.checksumLineEdit.sizePolicy().hasHeightForWidth())
        self.checksumLineEdit.setSizePolicy(sizePolicy)
        self.checksumLineEdit.setMinimumSize(QtCore.QSize(30, 23))
        self.checksumLineEdit.setMaximumSize(QtCore.QSize(30, 23))
        font = QtGui.QFont()
        font.setFamily("Monospace")
        self.checksumLineEdit.setFont(font)
        self.checksumLineEdit.setAutoFillBackground(False)
        self.checksumLineEdit.setText("")
        self.checksumLineEdit.setMaxLength(2)
        self.checksumLineEdit.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
        self.checksumLineEdit.setObjectName("checksumLineEdit")
        self.codeinfoLayout.addWidget(self.checksumLineEdit, 2, 2, 1, 1)
        spacerItem = QtGui.QSpacerItem(5, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.codeinfoLayout.addItem(spacerItem, 2, 1, 1, 1)
        spacerItem1 = QtGui.QSpacerItem(5, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.codeinfoLayout.addItem(spacerItem1, 0, 1, 1, 1)
        spacerItem2 = QtGui.QSpacerItem(5, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.codeinfoLayout.addItem(spacerItem2, 1, 1, 1, 1)
        self.gridLayout.addLayout(self.codeinfoLayout, 0, 0, 1, 2)
        self.codetypeLayout = QtGui.QGridLayout()
        self.codetypeLayout.setObjectName("codetypeLayout")
        self.c0Radio = QtGui.QRadioButton(self.centralwidget)
        self.c0Radio.setEnabled(True)
        self.c0Radio.setMinimumSize(QtCore.QSize(70, 21))
        self.c0Radio.setMaximumSize(QtCore.QSize(16777215, 21))
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.c0Radio.setFont(font)
        self.c0Radio.setObjectName("c0Radio")
        self.codetypeLayout.addWidget(self.c0Radio, 1, 0, 1, 1)
        self.c2d2Radio = QtGui.QRadioButton(self.centralwidget)
        self.c2d2Radio.setEnabled(True)
        self.c2d2Radio.setMinimumSize(QtCore.QSize(70, 21))
        self.c2d2Radio.setMaximumSize(QtCore.QSize(16777215, 21))
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.c2d2Radio.setFont(font)
        self.c2d2Radio.setObjectName("c2d2Radio")
        self.codetypeLayout.addWidget(self.c2d2Radio, 1, 2, 1, 1)
        self.f2f4Radio = QtGui.QRadioButton(self.centralwidget)
        self.f2f4Radio.setEnabled(True)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.f2f4Radio.sizePolicy().hasHeightForWidth())
        self.f2f4Radio.setSizePolicy(sizePolicy)
        self.f2f4Radio.setMinimumSize(QtCore.QSize(70, 21))
        self.f2f4Radio.setMaximumSize(QtCore.QSize(16777215, 21))
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.f2f4Radio.setFont(font)
        self.f2f4Radio.setObjectName("f2f4Radio")
        self.codetypeLayout.addWidget(self.f2f4Radio, 2, 0, 1, 1)
        self.rawRadio = QtGui.QRadioButton(self.centralwidget)
        self.rawRadio.setEnabled(True)
        self.rawRadio.setMinimumSize(QtCore.QSize(70, 21))
        self.rawRadio.setMaximumSize(QtCore.QSize(16777215, 21))
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.rawRadio.setFont(font)
        self.rawRadio.setChecked(True)
        self.rawRadio.setObjectName("rawRadio")
        self.codetypeLayout.addWidget(self.rawRadio, 2, 2, 1, 1)
        self.codetypeLabel = QtGui.QLabel(self.centralwidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.codetypeLabel.sizePolicy().hasHeightForWidth())
        self.codetypeLabel.setSizePolicy(sizePolicy)
        self.codetypeLabel.setMinimumSize(QtCore.QSize(100, 21))
        self.codetypeLabel.setMaximumSize(QtCore.QSize(16777215, 21))
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setWeight(75)
        font.setBold(True)
        self.codetypeLabel.setFont(font)
        self.codetypeLabel.setTextFormat(QtCore.Qt.PlainText)
        self.codetypeLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.codetypeLabel.setObjectName("codetypeLabel")
        self.codetypeLayout.addWidget(self.codetypeLabel, 0, 0, 1, 3)
        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.codetypeLayout.addItem(spacerItem3, 2, 1, 1, 1)
        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.codetypeLayout.addItem(spacerItem4, 1, 1, 1, 1)
        self.gridLayout.addLayout(self.codetypeLayout, 0, 3, 1, 2)
        self.opcodesLayout = QtGui.QGridLayout()
        self.opcodesLayout.setVerticalSpacing(11)
        self.opcodesLayout.setObjectName("opcodesLayout")
        self.opcodesLabel = QtGui.QLabel(self.centralwidget)
        self.opcodesLabel.setMinimumSize(QtCore.QSize(100, 17))
        self.opcodesLabel.setMaximumSize(QtCore.QSize(16777215, 17))
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setWeight(75)
        font.setBold(True)
        self.opcodesLabel.setFont(font)
        self.opcodesLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.opcodesLabel.setObjectName("opcodesLabel")
        self.opcodesLayout.addWidget(self.opcodesLabel, 0, 0, 1, 1)
        self.opcodesPTextEdit = QtGui.QPlainTextEdit(self.centralwidget)
        self.opcodesPTextEdit.setMinimumSize(QtCore.QSize(180, 311))
        self.opcodesPTextEdit.setMaximumSize(QtCore.QSize(16777215, 16777215))
        font = QtGui.QFont()
        font.setFamily("Monospace")
        self.opcodesPTextEdit.setFont(font)
        self.opcodesPTextEdit.setLineWrapMode(QtGui.QPlainTextEdit.NoWrap)
        self.opcodesPTextEdit.setBackgroundVisible(False)
        self.opcodesPTextEdit.setObjectName("opcodesPTextEdit")
        self.opcodesLayout.addWidget(self.opcodesPTextEdit, 1, 0, 1, 1)
        self.gridLayout.addLayout(self.opcodesLayout, 2, 0, 1, 1)
        self.buttonandpbarLayout = QtGui.QGridLayout()
        self.buttonandpbarLayout.setContentsMargins(-1, 40, -1, -1)
        self.buttonandpbarLayout.setObjectName("buttonandpbarLayout")
        self.dsmButton = QtGui.QPushButton(self.centralwidget)
        self.dsmButton.setMinimumSize(QtCore.QSize(40, 40))
        self.dsmButton.setMaximumSize(QtCore.QSize(40, 40))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.dsmButton.setFont(font)
        self.dsmButton.setCheckable(False)
        self.dsmButton.setChecked(False)
        self.dsmButton.setAutoDefault(True)
        self.dsmButton.setDefault(False)
        self.dsmButton.setFlat(False)
        self.dsmButton.setObjectName("dsmButton")
        self.buttonandpbarLayout.addWidget(self.dsmButton, 1, 1, 1, 1)
        spacerItem5 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.buttonandpbarLayout.addItem(spacerItem5, 1, 0, 1, 1)
        self.asmButton = QtGui.QPushButton(self.centralwidget)
        self.asmButton.setMinimumSize(QtCore.QSize(40, 40))
        self.asmButton.setMaximumSize(QtCore.QSize(40, 40))
        font = QtGui.QFont()
        font.setPointSize(24)
        self.asmButton.setFont(font)
        self.asmButton.setCheckable(False)
        self.asmButton.setChecked(False)
        self.asmButton.setAutoDefault(True)
        self.asmButton.setDefault(False)
        self.asmButton.setFlat(False)
        self.asmButton.setObjectName("asmButton")
        self.buttonandpbarLayout.addWidget(self.asmButton, 0, 1, 1, 1)
        spacerItem6 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.buttonandpbarLayout.addItem(spacerItem6, 0, 0, 1, 1)
        spacerItem7 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.buttonandpbarLayout.addItem(spacerItem7, 0, 2, 1, 1)
        spacerItem8 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.buttonandpbarLayout.addItem(spacerItem8, 1, 2, 1, 1)
        self.gridLayout.addLayout(self.buttonandpbarLayout, 2, 1, 1, 3)
        self.geckocodesLayout = QtGui.QGridLayout()
        self.geckocodesLayout.setVerticalSpacing(11)
        self.geckocodesLayout.setObjectName("geckocodesLayout")
        self.geckocodesLabel = QtGui.QLabel(self.centralwidget)
        self.geckocodesLabel.setMinimumSize(QtCore.QSize(100, 17))
        self.geckocodesLabel.setMaximumSize(QtCore.QSize(16777215, 17))
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setWeight(75)
        font.setBold(True)
        self.geckocodesLabel.setFont(font)
        self.geckocodesLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.geckocodesLabel.setObjectName("geckocodesLabel")
        self.geckocodesLayout.addWidget(self.geckocodesLabel, 0, 0, 1, 1)
        self.geckocodesPTextEdit = QtGui.QPlainTextEdit(self.centralwidget)
        self.geckocodesPTextEdit.setMinimumSize(QtCore.QSize(180, 311))
        font = QtGui.QFont()
        font.setFamily("Monospace")
        self.geckocodesPTextEdit.setFont(font)
        self.geckocodesPTextEdit.setLineWrapMode(QtGui.QPlainTextEdit.NoWrap)
        self.geckocodesPTextEdit.setObjectName("geckocodesPTextEdit")
        self.geckocodesLayout.addWidget(self.geckocodesPTextEdit, 1, 0, 1, 1)
        self.gridLayout.addLayout(self.geckocodesLayout, 2, 4, 1, 1)
        self.vertSep = QtGui.QFrame(self.centralwidget)
        self.vertSep.setMinimumSize(QtCore.QSize(50, 130))
        self.vertSep.setFrameShape(QtGui.QFrame.VLine)
        self.vertSep.setFrameShadow(QtGui.QFrame.Sunken)
        self.vertSep.setObjectName("vertSep")
        self.gridLayout.addWidget(self.vertSep, 0, 2, 1, 1)
        self.horiSep = QtGui.QFrame(self.centralwidget)
        self.horiSep.setMinimumSize(QtCore.QSize(510, 30))
        self.horiSep.setFrameShape(QtGui.QFrame.HLine)
        self.horiSep.setFrameShadow(QtGui.QFrame.Sunken)
        self.horiSep.setObjectName("horiSep")
        self.gridLayout.addWidget(self.horiSep, 1, 0, 1, 5)
        self.setCentralWidget(self.centralwidget)
        self.menubar = QtGui.QMenuBar(self)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 494, 22))
        self.menubar.setObjectName("menubar")
        self.menuFile = QtGui.QMenu(self.menubar)
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.menuFile.setFont(font)
        self.menuFile.setObjectName("menuFile")
        self.menuEdit = QtGui.QMenu(self.menubar)
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.menuEdit.setFont(font)
        self.menuEdit.setObjectName("menuEdit")
        self.menuHelp = QtGui.QMenu(self.menubar)
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.menuHelp.setFont(font)
        self.menuHelp.setObjectName("menuHelp")
        self.setMenuBar(self.menubar)
        self.statusbar = QtGui.QStatusBar(self)
        self.statusbar.setObjectName("statusbar")
        self.setStatusBar(self.statusbar)
        self.actionNew = QtGui.QAction(self)
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.actionNew.setFont(font)
        self.actionNew.setObjectName("actionNew")
        self.actionOpen = QtGui.QAction(self)
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.actionOpen.setFont(font)
        self.actionOpen.setObjectName("actionOpen")
        self.actionSave = QtGui.QAction(self)
        self.actionSave.setEnabled(False)
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.actionSave.setFont(font)
        self.actionSave.setObjectName("actionSave")
        self.actionSave_As = QtGui.QAction(self)
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.actionSave_As.setFont(font)
        self.actionSave_As.setObjectName("actionSave_As")
        self.actionReload = QtGui.QAction(self)
        self.actionReload.setEnabled(False)
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.actionReload.setFont(font)
        self.actionReload.setObjectName("actionReload")
        self.actionQuit = QtGui.QAction(self)
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.actionQuit.setFont(font)
        self.actionQuit.setMenuRole(QtGui.QAction.QuitRole)
        self.actionQuit.setObjectName("actionQuit")
        self.actionUndo = QtGui.QAction(self)
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.actionUndo.setFont(font)
        self.actionUndo.setMenuRole(QtGui.QAction.TextHeuristicRole)
        self.actionUndo.setObjectName("actionUndo")
        self.actionRedo = QtGui.QAction(self)
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.actionRedo.setFont(font)
        self.actionRedo.setObjectName("actionRedo")
        self.actionCut = QtGui.QAction(self)
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.actionCut.setFont(font)
        self.actionCut.setObjectName("actionCut")
        self.actionCopy = QtGui.QAction(self)
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.actionCopy.setFont(font)
        self.actionCopy.setObjectName("actionCopy")
        self.actionPaste = QtGui.QAction(self)
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.actionPaste.setFont(font)
        self.actionPaste.setObjectName("actionPaste")
        self.actionDelete = QtGui.QAction(self)
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.actionDelete.setFont(font)
        self.actionDelete.setObjectName("actionDelete")
        self.actionSelect_All = QtGui.QAction(self)
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.actionSelect_All.setFont(font)
        self.actionSelect_All.setObjectName("actionSelect_All")
        self.actionPreferences = QtGui.QAction(self)
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.actionPreferences.setFont(font)
        self.actionPreferences.setMenuRole(QtGui.QAction.PreferencesRole)
        self.actionPreferences.setObjectName("actionPreferences")
        self.actionAbout_PyiiASMH = QtGui.QAction(self)
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.actionAbout_PyiiASMH.setFont(font)
        self.actionAbout_PyiiASMH.setMenuRole(QtGui.QAction.AboutRole)
        self.actionAbout_PyiiASMH.setObjectName("actionAbout_PyiiASMH")
        self.actionAbout_Qt = QtGui.QAction(self)
        self.actionAbout_Qt.setStatusTip("")
        font = QtGui.QFont()
        font.setFamily("Sans Serif")
        self.actionAbout_Qt.setFont(font)
        self.actionAbout_Qt.setMenuRole(QtGui.QAction.AboutQtRole)
        self.actionAbout_Qt.setObjectName("actionAbout_Qt")
        self.menuFile.addAction(self.actionNew)
        self.menuFile.addAction(self.actionOpen)
        self.menuFile.addSeparator()
        self.menuFile.addAction(self.actionSave)
        self.menuFile.addAction(self.actionSave_As)
        self.menuFile.addAction(self.actionReload)
        self.menuFile.addSeparator()
        self.menuFile.addAction(self.actionQuit)
        self.menuEdit.addAction(self.actionPreferences)
        self.menuHelp.addAction(self.actionAbout_PyiiASMH)
        self.menuHelp.addAction(self.actionAbout_Qt)
        self.menubar.addAction(self.menuFile.menuAction())
        self.menubar.addAction(self.menuEdit.menuAction())
        self.menubar.addAction(self.menuHelp.menuAction())

        self.retranslateUi()
        QtCore.QObject.connect(self.c2d2Radio, QtCore.SIGNAL("toggled(bool)"), self.bapoLabel.setEnabled)
        QtCore.QObject.connect(self.c2d2Radio, QtCore.SIGNAL("toggled(bool)"), self.bapoLineEdit.setEnabled)
        QtCore.QObject.connect(self.c2d2Radio, QtCore.SIGNAL("toggled(bool)"), self.xorLabel.setDisabled)
        QtCore.QObject.connect(self.c2d2Radio, QtCore.SIGNAL("toggled(bool)"), self.xorLineEdit.setDisabled)
        QtCore.QObject.connect(self.c2d2Radio, QtCore.SIGNAL("toggled(bool)"), self.checksumLabel.setDisabled)
        QtCore.QObject.connect(self.c2d2Radio, QtCore.SIGNAL("toggled(bool)"), self.checksumLineEdit.setDisabled)
        QtCore.QObject.connect(self.c0Radio, QtCore.SIGNAL("toggled(bool)"), self.bapoLabel.setDisabled)
        QtCore.QObject.connect(self.c0Radio, QtCore.SIGNAL("toggled(bool)"), self.bapoLineEdit.setDisabled)
        QtCore.QObject.connect(self.c0Radio, QtCore.SIGNAL("toggled(bool)"), self.xorLabel.setDisabled)
        QtCore.QObject.connect(self.c0Radio, QtCore.SIGNAL("toggled(bool)"), self.xorLineEdit.setDisabled)
        QtCore.QObject.connect(self.c0Radio, QtCore.SIGNAL("toggled(bool)"), self.checksumLabel.setDisabled)
        QtCore.QObject.connect(self.c0Radio, QtCore.SIGNAL("toggled(bool)"), self.checksumLineEdit.setDisabled)
        QtCore.QObject.connect(self.rawRadio, QtCore.SIGNAL("toggled(bool)"), self.bapoLabel.setDisabled)
        QtCore.QObject.connect(self.rawRadio, QtCore.SIGNAL("toggled(bool)"), self.bapoLineEdit.setDisabled)
        QtCore.QObject.connect(self.rawRadio, QtCore.SIGNAL("toggled(bool)"), self.xorLabel.setDisabled)
        QtCore.QObject.connect(self.rawRadio, QtCore.SIGNAL("toggled(bool)"), self.xorLineEdit.setDisabled)
        QtCore.QObject.connect(self.rawRadio, QtCore.SIGNAL("toggled(bool)"), self.checksumLabel.setDisabled)
        QtCore.QObject.connect(self.rawRadio, QtCore.SIGNAL("toggled(bool)"), self.checksumLineEdit.setDisabled)
        QtCore.QObject.connect(self.f2f4Radio, QtCore.SIGNAL("toggled(bool)"), self.bapoLabel.setEnabled)
        QtCore.QObject.connect(self.f2f4Radio, QtCore.SIGNAL("toggled(bool)"), self.bapoLineEdit.setEnabled)
        QtCore.QObject.connect(self.f2f4Radio, QtCore.SIGNAL("toggled(bool)"), self.xorLabel.setEnabled)
        QtCore.QObject.connect(self.f2f4Radio, QtCore.SIGNAL("toggled(bool)"), self.xorLineEdit.setEnabled)
        QtCore.QObject.connect(self.f2f4Radio, QtCore.SIGNAL("toggled(bool)"), self.checksumLabel.setEnabled)
        QtCore.QObject.connect(self.f2f4Radio, QtCore.SIGNAL("toggled(bool)"), self.checksumLineEdit.setEnabled)
        QtCore.QMetaObject.connectSlotsByName(self)

    def retranslateUi(self):
        self.setWindowTitle(QtGui.QApplication.translate("MainWindow", "PyiiASMH - untitled", None, QtGui.QApplication.UnicodeUTF8))
        self.bapoLabel.setText(QtGui.QApplication.translate("MainWindow", "Address/Offset", None, QtGui.QApplication.UnicodeUTF8))
        self.bapoLineEdit.setPlaceholderText(QtGui.QApplication.translate("MainWindow", "80000000", None, QtGui.QApplication.UnicodeUTF8))
        self.xorLabel.setText(QtGui.QApplication.translate("MainWindow", "XOR Checksum", None, QtGui.QApplication.UnicodeUTF8))
        self.xorLineEdit.setPlaceholderText(QtGui.QApplication.translate("MainWindow", "0000", None, QtGui.QApplication.UnicodeUTF8))
        self.checksumLabel.setText(QtGui.QApplication.translate("MainWindow", "Before/After", None, QtGui.QApplication.UnicodeUTF8))
        self.checksumLineEdit.setPlaceholderText(QtGui.QApplication.translate("MainWindow", "00", None, QtGui.QApplication.UnicodeUTF8))
        self.c0Radio.setText(QtGui.QApplication.translate("MainWindow", "C0", None, QtGui.QApplication.UnicodeUTF8))
        self.c2d2Radio.setText(QtGui.QApplication.translate("MainWindow", "C2/D2", None, QtGui.QApplication.UnicodeUTF8))
        self.f2f4Radio.setText(QtGui.QApplication.translate("MainWindow", "F2/F4", None, QtGui.QApplication.UnicodeUTF8))
        self.rawRadio.setText(QtGui.QApplication.translate("MainWindow", "RAW", None, QtGui.QApplication.UnicodeUTF8))
        self.codetypeLabel.setText(QtGui.QApplication.translate("MainWindow", "Code Type", None, QtGui.QApplication.UnicodeUTF8))
        self.opcodesLabel.setText(QtGui.QApplication.translate("MainWindow", "PPC Opcodes", None, QtGui.QApplication.UnicodeUTF8))
        self.dsmButton.setToolTip(QtGui.QApplication.translate("MainWindow", "Disassemble Gecko codes", None, QtGui.QApplication.UnicodeUTF8))
        self.dsmButton.setText(QtGui.QApplication.translate("MainWindow", "←", None, QtGui.QApplication.UnicodeUTF8))
        self.asmButton.setToolTip(QtGui.QApplication.translate("MainWindow", "Assemble opcodes", None, QtGui.QApplication.UnicodeUTF8))
        self.asmButton.setText(QtGui.QApplication.translate("MainWindow", "→", None, QtGui.QApplication.UnicodeUTF8))
        self.geckocodesLabel.setText(QtGui.QApplication.translate("MainWindow", "Gecko Codes", None, QtGui.QApplication.UnicodeUTF8))
        self.menuFile.setTitle(QtGui.QApplication.translate("MainWindow", "&File", None, QtGui.QApplication.UnicodeUTF8))
        self.menuEdit.setTitle(QtGui.QApplication.translate("MainWindow", "&Edit", None, QtGui.QApplication.UnicodeUTF8))
        self.menuHelp.setTitle(QtGui.QApplication.translate("MainWindow", "&Help", None, QtGui.QApplication.UnicodeUTF8))
        self.actionNew.setText(QtGui.QApplication.translate("MainWindow", "&New", None, QtGui.QApplication.UnicodeUTF8))
        self.actionNew.setStatusTip(QtGui.QApplication.translate("MainWindow", "Start a new session", None, QtGui.QApplication.UnicodeUTF8))
        self.actionNew.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+N", None, QtGui.QApplication.UnicodeUTF8))
        self.actionOpen.setText(QtGui.QApplication.translate("MainWindow", "&Open...", None, QtGui.QApplication.UnicodeUTF8))
        self.actionOpen.setStatusTip(QtGui.QApplication.translate("MainWindow", "Open a saved session", None, QtGui.QApplication.UnicodeUTF8))
        self.actionOpen.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+O", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSave.setText(QtGui.QApplication.translate("MainWindow", "&Save", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSave.setStatusTip(QtGui.QApplication.translate("MainWindow", "Save the current session", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSave.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+S", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSave_As.setText(QtGui.QApplication.translate("MainWindow", "Save &As...", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSave_As.setStatusTip(QtGui.QApplication.translate("MainWindow", "Save the current session to another file", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSave_As.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+Shift+S", None, QtGui.QApplication.UnicodeUTF8))
        self.actionReload.setText(QtGui.QApplication.translate("MainWindow", "&Reload", None, QtGui.QApplication.UnicodeUTF8))
        self.actionReload.setStatusTip(QtGui.QApplication.translate("MainWindow", "Reload the current session from disk", None, QtGui.QApplication.UnicodeUTF8))
        self.actionReload.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+R", None, QtGui.QApplication.UnicodeUTF8))
        self.actionQuit.setText(QtGui.QApplication.translate("MainWindow", "&Quit", None, QtGui.QApplication.UnicodeUTF8))
        self.actionQuit.setStatusTip(QtGui.QApplication.translate("MainWindow", "Quit the application", None, QtGui.QApplication.UnicodeUTF8))
        self.actionQuit.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+Q", None, QtGui.QApplication.UnicodeUTF8))
        self.actionUndo.setText(QtGui.QApplication.translate("MainWindow", "Undo", None, QtGui.QApplication.UnicodeUTF8))
        self.actionUndo.setStatusTip(QtGui.QApplication.translate("MainWindow", "Undo the last action", None, QtGui.QApplication.UnicodeUTF8))
        self.actionUndo.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+Z", None, QtGui.QApplication.UnicodeUTF8))
        self.actionRedo.setText(QtGui.QApplication.translate("MainWindow", "Redo", None, QtGui.QApplication.UnicodeUTF8))
        self.actionRedo.setStatusTip(QtGui.QApplication.translate("MainWindow", "Redo the last action", None, QtGui.QApplication.UnicodeUTF8))
        self.actionRedo.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+Shift+Z", None, QtGui.QApplication.UnicodeUTF8))
        self.actionCut.setText(QtGui.QApplication.translate("MainWindow", "Cut", None, QtGui.QApplication.UnicodeUTF8))
        self.actionCut.setStatusTip(QtGui.QApplication.translate("MainWindow", "Cuts the selected text and places it on the clipboard", None, QtGui.QApplication.UnicodeUTF8))
        self.actionCut.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+X", None, QtGui.QApplication.UnicodeUTF8))
        self.actionCopy.setText(QtGui.QApplication.translate("MainWindow", "Copy", None, QtGui.QApplication.UnicodeUTF8))
        self.actionCopy.setStatusTip(QtGui.QApplication.translate("MainWindow", "Copies the selected text and places it on the clipboard", None, QtGui.QApplication.UnicodeUTF8))
        self.actionCopy.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+C", None, QtGui.QApplication.UnicodeUTF8))
        self.actionPaste.setText(QtGui.QApplication.translate("MainWindow", "Paste", None, QtGui.QApplication.UnicodeUTF8))
        self.actionPaste.setStatusTip(QtGui.QApplication.translate("MainWindow", "Paste the contents of the clipboard", None, QtGui.QApplication.UnicodeUTF8))
        self.actionPaste.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+V", None, QtGui.QApplication.UnicodeUTF8))
        self.actionDelete.setText(QtGui.QApplication.translate("MainWindow", "Delete", None, QtGui.QApplication.UnicodeUTF8))
        self.actionDelete.setStatusTip(QtGui.QApplication.translate("MainWindow", "Deletes the selected text", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSelect_All.setText(QtGui.QApplication.translate("MainWindow", "Select All", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSelect_All.setStatusTip(QtGui.QApplication.translate("MainWindow", "Select all of the text", None, QtGui.QApplication.UnicodeUTF8))
        self.actionSelect_All.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+A", None, QtGui.QApplication.UnicodeUTF8))
        self.actionPreferences.setText(QtGui.QApplication.translate("MainWindow", "&Preferences...", None, QtGui.QApplication.UnicodeUTF8))
        self.actionPreferences.setStatusTip(QtGui.QApplication.translate("MainWindow", "Open the application preferences dialog", None, QtGui.QApplication.UnicodeUTF8))
        self.actionAbout_PyiiASMH.setText(QtGui.QApplication.translate("MainWindow", "About &PyiiASMH...", None, QtGui.QApplication.UnicodeUTF8))
        self.actionAbout_Qt.setText(QtGui.QApplication.translate("MainWindow", "About &Qt...", None, QtGui.QApplication.UnicodeUTF8))
